package com.ict.web.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.ict.web.domain.ExtractReview;
import com.ict.web.domain.MilestoneInformationRelation;
import com.ict.web.mapper.ExtractReviewMapper;
import com.ict.web.mapper.MilestoneInformationRelationMapper;
import com.ict.web.service.IExtractReviewService;
import com.ict.web.service.IMilestoneInformationRelationService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;


/**
 * 评审任务与抽取的专家关系Service业务层处理
 * 
 * @author xc
 * @date 2022-02-25
 */
@Service
public class MilestoneInformationRelationImpl extends ServiceImpl<MilestoneInformationRelationMapper, MilestoneInformationRelation> implements IMilestoneInformationRelationService
{
    @Autowired
    private MilestoneInformationRelationMapper milestoneInformationRelationMapper;


    @Override
    public int batchInsert(Long proId, List<Long> list) {
        List<MilestoneInformationRelation> milestoneInformationRelationList = new ArrayList<>();
        for (Long milepostId : list)
        {
            MilestoneInformationRelation milestoneInformationRelation = new MilestoneInformationRelation();
            milestoneInformationRelation.setProId(proId);
            milestoneInformationRelation.setMilepostId(milepostId);
            milestoneInformationRelationList.add(milestoneInformationRelation);
        }
        return milestoneInformationRelationMapper.batchInsert(milestoneInformationRelationList);
    }
}
